import request from '@/utils/request'

// 部门

/**
 * 获取列表
 *
 * @export
 * @param {*} data  { keyword }
 * @returns
 */
export function fetchDeptFindPage(data) {
  return request({
    url: '/pc/base/dept/findPage',
    method: 'post',
    data
  })
}

/**
 * 获取详情
 *
 * @export
 * @param {*} data { id }
 * @returns
 */
export function fetchDeptGet(params) {
  return request({
    url: '/pc/base/dept/get',
    method: 'get',
    params
  })
}

/**
 * 添加
 *
 * @export
 * @param {*} data { orgName, parentOrgId }
 * @returns
 */
export function fetchDeptAdd(data) {
  return request({
    url: '/pc/base/dept/add',
    method: 'post',
    data
  })
}

/**
 * 更新
 *
 * @export
 * @param {*} data { orgName }
 * @returns
 */
export function fetchDeptUpdate(data) {
  return request({
    url: '/pc/base/dept/update',
    method: 'post',
    data
  })
}

/**
 * 删除
 *
 * @export
 * @param {*} data { id }
 * @returns
 */
export function fetchDeptDelete(params) {
  return request({
    url: '/pc/base/dept/delete',
    method: 'post',
    params
  })
}

/**
 * 获取下拉
 *
 * @export
 * @returns
 */
export function fetchDeptSelectByDropdownList() {
  return request({
    url: '/pc/base/dept/selectByDropdownList',
    method: 'post'
  })
}
